package dr.mini.controller;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import dr.mini.dao.MemberDao;
import dr.mini.dao.MemberDaoImpl;

@Controller
public class DeleteController{

	private MemberDao memberDao;
	@Autowired
	public void setMemberDao(MemberDao memberDao) {
		System.out.println("test");
		this.memberDao = memberDao;
	}
	
	@RequestMapping("/delete.do")
	public ModelAndView process(@RequestParam("id") String id,HttpSession session){
		memberDao.deleteMember(id);
		session.invalidate();
		return new ModelAndView("redirect:list.do");
	}
	
}
